package com.zhilianbao.leyaogo.ui.activity.me.moneyaccount;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.TextView;

import com.bql.statetypelayout.AnimationStateTypeLayout;
import com.zhilianbao.leyaogo.R;
import com.zhilianbao.leyaogo.constants.IntentConfig;
import com.zhilianbao.leyaogo.http.api.AccountApi;
import com.zhilianbao.leyaogo.http.callback.LoadingViewCallback;
import com.zhilianbao.leyaogo.model.response.me.CardDetailResponse;
import com.zhilianbao.leyaogo.ui.activity.base.BaseOkHttpActivity;
import com.zhilianbao.leyaogo.view.widgets.DetailsTopBanner;
import com.zhilianbao.leyaogo.view.widgets.MoneyTextView;

import butterknife.BindView;
import okhttp3.Response;

/**
 * Created by gyt on 2017/3/8
 * 卡券详情页面
 */
public class CardDetailActivity extends BaseOkHttpActivity {
    @BindView(R.id.card_details_top_banner)
    DetailsTopBanner         mCardDetailsTopBanner;
    @BindView(R.id.tv_details_card_name)
    TextView                 mTvDetailsCardName;
    @BindView(R.id.tv_details_card_desc)
    TextView                 mTvDetailsCardDesc;
    @BindView(R.id.tv_details_card_price)
    MoneyTextView            mTvDetailsCardPrice;
    @BindView(R.id.stateLayout)
    AnimationStateTypeLayout mStateLayout;

    @Override
    protected int getContentViewLayoutID() {
        return R.layout.activity_card_detail;
    }

    @Override
    protected void initViewsAndEvents(Bundle savedInstanceState) {

        initToolbar(getString(R.string.card_detail));
        if (getIntent() == null) {
            return;
        }
        long cardId = getIntent().getLongExtra(IntentConfig.CARD_ID_DATA, 0);
        getCardDetail(cardId);
    }


    private void getCardDetail(long cardId) {
        AccountApi.getCardDetail(this, cardId, new LoadingViewCallback<CardDetailResponse>(this, true) {
            @Override
            public void errorLeftOrEmptyBtnClick(View v) {

            }

            @Override
            public void onResultSuccess(CardDetailResponse cardDetail, @Nullable Response response, LoadingViewCallback callback) {

            }
        });
    }


}
